const express = require('express');
const router = express.Router();
const palmAnalysisController = require('../controllers/palmAnalysis.controller');
const { authenticateToken } = require('../middleware/auth.middleware');

/**
 * @desc 上传手部图片进行手相分析
 * @route POST /api/palm-analysis/analyze
 * @access Private
 */
router.post('/analyze', authenticateToken, palmAnalysisController.analyzePalm);

/**
 * @desc 获取手相分析结果
 * @route GET /api/palm-analysis/:id
 * @access Private
 */
router.get('/:id', authenticateToken, palmAnalysisController.getPalmAnalysis);

/**
 * @desc 保存手相分析结果
 * @route POST /api/palm-analysis/save
 * @access Private
 */
router.post('/save', authenticateToken, palmAnalysisController.savePalmAnalysis);

/**
 * @desc 获取当前用户的手相分析历史记录
 * @route GET /api/palm-analysis/history
 * @access Private
 */
router.get('/history', authenticateToken, palmAnalysisController.getUserPalmAnalyses);

module.exports = router;